typedef int			sim_error;
// All errors < 0, all notifications > 0
// -1 to -100, global conditions
// -101 to -200, CPU conditions
// -201 to -300, CP0 conditions
// -301 to -400, FPU conditions
// -401 to -500, MMU conditions
// -501 to -500, cache conditions
// -601 to -700, TLB conditions
// -701 to -800, physical memory conditions
// -801 to -900, host system conditions [always fatal]
#define E_OKAY			    0
#define E_INVALID		(  -2)
#define E_ILLEGAL		(  -3)
#define E_ALIGNMENT		(  -4)

typedef sim_error		mmu_error;
#define E_MMU_STALL			(-401)
#define E_MMU_FAIL			(-402)

typedef sim_error		cache_error;
#define E_CACHE_HIT			( 501)
#define E_CACHE_MISS		( 502)
#define E_CACHE_BUSY		(-503)
#define E_CACHE_WRITEBACK	(-504)
#define E_CACHE_FULL		(-505)
#define E_CACHE_CLEAN		( 506)

typedef sim_error		tlb_error;
#define E_TLB_HIT			( 601)
#define E_TLB_MISS			(-602)

typedef sim_error		phys_error;
#define E_NOPAGE			( 701)

typedef sim_error		sys_error;
#define E_SYS_NOMEM			(-801)

